




/*
'===============================================================================
'  MP.LayerHelper.MP_OBS.BL.MbLogPageManagerBase
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.DAL.FactoryClasses;
using MP.LayerHelper.MP_OBS.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace MP.LayerHelper.MP_OBS.BLL
{
	public class MbLogPageManagerBase : ManagerBase
	{
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		
		public MbLogPageManagerBase()
		{
			// Nothing for now.
		}
		
		public override string TableName()
        {
            return "MbLogPage";
        }
		
		public MbLogPageEntity Insert(MbLogPageEntity _MbLogPageEntity)
		{
			return Insert(_MbLogPageEntity, "");
		}
		
		public MbLogPageEntity Insert(MbLogPageEntity _MbLogPageEntity, string controlId)
		{
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.SaveEntity(_MbLogPageEntity, true);
				MbLogPageFields field = new MbLogPageFields();
                LogEntity(_MbLogPageEntity, field, AcInsert, controlId);
			}
			return _MbLogPageEntity;
		}

		
		public MbLogPageEntity Insert(Guid Id, Guid PageId, DateTime LogFirst, DateTime LogLast, Guid UserIdLog, string UserNameLog, int ViewLogs, Guid BranchId)
		{
			MbLogPageEntity _MbLogPageEntity = new MbLogPageEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_MbLogPageEntity.Id = Id;
				_MbLogPageEntity.PageId = PageId;
				_MbLogPageEntity.LogFirst = LogFirst;
				_MbLogPageEntity.LogLast = LogLast;
				_MbLogPageEntity.UserIdLog = UserIdLog;
				_MbLogPageEntity.UserNameLog = UserNameLog;
				_MbLogPageEntity.ViewLogs = ViewLogs;
				_MbLogPageEntity.BranchId = BranchId;
				MbLogPageFields field = new MbLogPageFields();
                LogEntity(_MbLogPageEntity, field, AcInsert);
				adapter.SaveEntity(_MbLogPageEntity, true);
			}
			return _MbLogPageEntity;
		}

		public MbLogPageEntity Insert(Guid PageId, DateTime LogFirst, DateTime LogLast, Guid UserIdLog, string UserNameLog, int ViewLogs, Guid BranchId)
		{
			MbLogPageEntity _MbLogPageEntity = new MbLogPageEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_MbLogPageEntity.PageId = PageId;
				_MbLogPageEntity.LogFirst = LogFirst;
				_MbLogPageEntity.LogLast = LogLast;
				_MbLogPageEntity.UserIdLog = UserIdLog;
				_MbLogPageEntity.UserNameLog = UserNameLog;
				_MbLogPageEntity.ViewLogs = ViewLogs;
				_MbLogPageEntity.BranchId = BranchId;
				adapter.SaveEntity(_MbLogPageEntity, true);
				MbLogPageFields field = new MbLogPageFields();
                LogEntity(_MbLogPageEntity, field, AcInsert);
			}
			return _MbLogPageEntity;
		}
		
		public bool Update(MbLogPageEntity _MbLogPageEntity)
        {
            return Update(_MbLogPageEntity, "");
        }

		public bool Update(MbLogPageEntity _MbLogPageEntity, string controlId)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				RelationPredicateBucket filter = new RelationPredicateBucket();
				IPredicateExpression _PredicateExpression = new PredicateExpression();
				_PredicateExpression.Add(MbLogPageFields.Id == _MbLogPageEntity.Id);
					
				filter.PredicateExpression.Add(_PredicateExpression);

				adapter.UpdateEntitiesDirectly(_MbLogPageEntity, filter);
				toReturn = true;
				
				MbLogPageFields field = new MbLogPageFields();
                LogEntity(_MbLogPageEntity, field, AcUpdate, controlId);
			}
			return toReturn;
		}
		
		public bool Update(MbLogPageEntity _MbLogPageEntity, RelationPredicateBucket filter)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.UpdateEntitiesDirectly(_MbLogPageEntity, filter);
				toReturn = true;
				
				MbLogPageFields field = new MbLogPageFields();
                LogEntity(_MbLogPageEntity, field, AcUpdate);
			}
			return toReturn;
		}

		public bool Update(Guid Id, Guid PageId, DateTime LogFirst, DateTime LogLast, Guid UserIdLog, string UserNameLog, int ViewLogs, Guid BranchId)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				MbLogPageEntity _MbLogPageEntity = new MbLogPageEntity(Id);
				if (adapter.FetchEntity(_MbLogPageEntity))
				{
				
					_MbLogPageEntity.PageId = PageId;
					_MbLogPageEntity.LogFirst = LogFirst;
					_MbLogPageEntity.LogLast = LogLast;
					_MbLogPageEntity.UserIdLog = UserIdLog;
					_MbLogPageEntity.UserNameLog = UserNameLog;
					_MbLogPageEntity.ViewLogs = ViewLogs;
					_MbLogPageEntity.BranchId = BranchId;
					adapter.SaveEntity(_MbLogPageEntity, true);
					toReturn = true;
					
					MbLogPageFields field = new MbLogPageFields();
					LogEntity(_MbLogPageEntity, field, AcUpdate);
				}
			}
			return toReturn;
		}

		public bool Delete(Guid Id)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				MbLogPageEntity _MbLogPageEntity = new MbLogPageEntity(Id);
				if (adapter.FetchEntity(_MbLogPageEntity))
				{
					adapter.DeleteEntity(_MbLogPageEntity);
					toReturn = true;
				}
			}
			return toReturn;
		}
		
		public void DeleteAll() 
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.DeleteEntitiesDirectly("MbLogPageEntity", null);
			}
		}
		
		
		public int DeleteById(Guid Id)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByPageId(Guid PageId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.PageId == PageId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLogFirst(DateTime LogFirst)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogFirst == LogFirst);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLogLast(DateTime LogLast)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogLast == LogLast);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUserIdLog(Guid UserIdLog)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserIdLog == UserIdLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByUserNameLog(string UserNameLog)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserNameLog == UserNameLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByViewLogs(int ViewLogs)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.ViewLogs == ViewLogs);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByBranchId(Guid BranchId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.BranchId == BranchId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("MbLogPageEntity", filter);
			}
			return toReturn;
		}
		

		
		public MbLogPageEntity SelectOne(Guid Id)
		{
			MbLogPageEntity toReturn = null;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				MbLogPageEntity _MbLogPageEntity = new MbLogPageEntity(Id);
				if (adapter.FetchEntity(_MbLogPageEntity))
				{
					toReturn = _MbLogPageEntity;
				}
			}
			return toReturn;
		}

		// Return DataTable
		public DataTable SelectAllRDT()
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, null, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectAllLST()
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, null, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectAllLST_Paged(int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, null, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByIdLST(Guid Id)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByIdLST_Paged(Guid Id, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT(Guid Id)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT_Paged(Guid Id, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByPageIdLST(Guid PageId)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.PageId == PageId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByPageIdLST_Paged(Guid PageId, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.PageId == PageId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByPageIdRDT(Guid PageId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.PageId == PageId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByPageIdRDT_Paged(Guid PageId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.PageId == PageId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByLogFirstLST(DateTime LogFirst)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogFirst == LogFirst);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByLogFirstLST_Paged(DateTime LogFirst, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogFirst == LogFirst);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLogFirstRDT(DateTime LogFirst)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogFirst == LogFirst);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByLogFirstRDT_Paged(DateTime LogFirst, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogFirst == LogFirst);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByLogLastLST(DateTime LogLast)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogLast == LogLast);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByLogLastLST_Paged(DateTime LogLast, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogLast == LogLast);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLogLastRDT(DateTime LogLast)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogLast == LogLast);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByLogLastRDT_Paged(DateTime LogLast, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.LogLast == LogLast);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByUserIdLogLST(Guid UserIdLog)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserIdLog == UserIdLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByUserIdLogLST_Paged(Guid UserIdLog, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserIdLog == UserIdLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUserIdLogRDT(Guid UserIdLog)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserIdLog == UserIdLog);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByUserIdLogRDT_Paged(Guid UserIdLog, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserIdLog == UserIdLog);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByUserNameLogLST(string UserNameLog)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserNameLog == UserNameLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByUserNameLogLST_Paged(string UserNameLog, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserNameLog == UserNameLog);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByUserNameLogRDT(string UserNameLog)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserNameLog == UserNameLog);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByUserNameLogRDT_Paged(string UserNameLog, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.UserNameLog == UserNameLog);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByViewLogsLST(int ViewLogs)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.ViewLogs == ViewLogs);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByViewLogsLST_Paged(int ViewLogs, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.ViewLogs == ViewLogs);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByViewLogsRDT(int ViewLogs)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.ViewLogs == ViewLogs);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByViewLogsRDT_Paged(int ViewLogs, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.ViewLogs == ViewLogs);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByBranchIdLST(Guid BranchId)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.BranchId == BranchId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null);
			}
			return _MbLogPageCollection;
		}
		
		// Return EntityCollection<MbLogPageEntity>
		public EntityCollection<MbLogPageEntity> SelectByBranchIdLST_Paged(Guid BranchId, int PageNumber, int PageSize)
		{
			EntityCollection<MbLogPageEntity> _MbLogPageCollection = new EntityCollection<MbLogPageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.BranchId == BranchId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_MbLogPageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _MbLogPageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByBranchIdRDT(Guid BranchId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.BranchId == BranchId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByBranchIdRDT_Paged(Guid BranchId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _MbLogPageCollection = new EntityCollection(new MbLogPageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(MbLogPageFields.BranchId == BranchId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_MbLogPageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		

	}
}
